package roborally.model.evaluables.conditions;

import roborally.model.evaluables.Evaluable;
import roborally.model.evaluables.RobotCondition;
import roborally.model.*;

public class EnergyAtLeast extends RobotCondition implements Evaluable{
	private final EnergyAmount energyAmount;
	public EnergyAtLeast(Robot robot, EnergyAmount energyAmount) throws IllegalArgumentException {
		super(robot);
		this.energyAmount = energyAmount;
	}
	
	/**
	 * @return Returns true if the robot's energy level is at least as large as this condition's energyAmount.
	 */
	@Override
	public boolean evaluate(){
		if(getRobot().getEnergy().compareTo(this.energyAmount) != -1) return true;
		return false;
	}

}
